﻿<phone:PhoneApplicationPage
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
	x:Class="GreekWP7.MainPage"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource PhoneForegroundBrush}"
	SupportedOrientations="Portrait" Orientation="Portrait"
    IsTabStop="True"
	shell:SystemTray.IsVisible="True" xmlns:my="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls">
    <phone:PhoneApplicationPage.Resources>
    	<Style x:Key="BorderPreviewStyle" TargetType="Border">
            <Setter Property="Background" Value="White" />
            <Setter Property="BorderBrush" Value="Black" />
            <Setter Property="BorderThickness" Value="3" />
            <Setter Property="Height" Value="90" />
            <Setter Property="Width" Value="51" />
            <Setter Property="Canvas.ZIndex" Value="9999" />
        </Style>
        <Style x:Key="TextBlockPreviewStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="FontSize" Value="40" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
        <Style x:Key="KeyboardButtonStyle" TargetType="Button">
            <Setter Property="Background" Value="#474747"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
            <Setter Property="FontSize" Value="29.333"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="Height" Value="90"/>
            <Setter Property="Width" Value="45"/>
            <Setter Property="ClickMode" Value="Press"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#474747" MinWidth="45" Width="{TemplateBinding Width}" Margin="0,0,0,0" HorizontalAlignment="Left" >
                    		<VisualStateManager.VisualStateGroups>
                    			<VisualStateGroup x:Name="CommonStates">
                    				<VisualState x:Name="Normal"/>
                    				<VisualState x:Name="MouseOver"/>
                    				<VisualState x:Name="Pressed">
                    					<Storyboard>
                    						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                    							<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                    						</ObjectAnimationUsingKeyFrames>
                    						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                    							<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                    						</ObjectAnimationUsingKeyFrames>
                    						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                    							<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                    						</ObjectAnimationUsingKeyFrames>
                    					</Storyboard>
                    				</VisualState>
                    				<VisualState x:Name="Disabled">
                    					<Storyboard>
                    						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                    							<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                    						</ObjectAnimationUsingKeyFrames>
                    						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                    							<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                    						</ObjectAnimationUsingKeyFrames>
                    						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                    							<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
                    						</ObjectAnimationUsingKeyFrames>
                    					</Storyboard>
                    				</VisualState>
                    			</VisualStateGroup>
                    			<VisualStateGroup x:Name="FocusStates">
                    				<VisualState x:Name="Focused"/>
                    				<VisualState x:Name="Unfocused"/>
                    			</VisualStateGroup>
                    		</VisualStateManager.VisualStateGroups>
                    		<Border Width="{TemplateBinding Width}" x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" CornerRadius="0" HorizontalAlignment="Center" VerticalAlignment="Center">
                    			<ContentControl x:Name="ContentContainer" Background="{TemplateBinding Background}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" />
                    		</Border>
                    	</Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <Grid  x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock  x:Name="ApplicationTitle"
                       Text="Ελληνικό Πληκτρολόγιο"
                       Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0,242,0" />
        </Grid>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Margin="0,50,0,0" Grid.RowSpan="2">
            
            <Border x:Name="textBlockBorder" Height="255" Margin="31,2,75,0" VerticalAlignment="Top" BorderBrush="{StaticResource PhoneForegroundBrush}" Width="374" BorderThickness="3">
                <ScrollViewer x:Name="scrollViewer">
                    <StackPanel Orientation="Vertical">
                        <TextBlock x:Name="textBlock"
            			TextWrapping="Wrap" FontSize="24" Width="352" />
                        <TextBox TextWrapping="Wrap" FontSize="24" x:Name="copyTextBox" Width="352" Visibility="Collapsed" IsReadOnly="True" />
                    </StackPanel>
                </ScrollViewer>
            </Border>
            <Grid Margin="0,263,0,2" Name="keysGrid" MouseMove="keysGrid_MouseMove" >
                <Button x:Name="q" Tag="IsLetter" Content="q"  Style="{StaticResource KeyboardButtonStyle}" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" Height="90" VerticalAlignment="Top" Margin="1,0,0,0" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove" />
                <Button x:Name="w" Tag="IsLetter" Content="w" Style="{StaticResource KeyboardButtonStyle}" Margin="49,0,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" Height="90" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="e" Tag="IsLetter" Content="e"  Style="{StaticResource KeyboardButtonStyle}" Margin="97,0,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" Height="90" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="r" Tag="IsLetter" Content="r" Style="{StaticResource KeyboardButtonStyle}" Margin="145,0,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" Height="90" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="t" Tag="IsLetter" Content="t"  Style="{StaticResource KeyboardButtonStyle}" Margin="193,0,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" Height="90" VerticalAlignment="Top" Width="45" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="y" Tag="IsLetter" Content="y" Style="{StaticResource KeyboardButtonStyle}" Margin="241,0,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" Height="90" VerticalAlignment="Top" Width="45" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="u" Tag="IsLetter" Content="u" Style="{StaticResource KeyboardButtonStyle}" Margin="289,0,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" Height="90" VerticalAlignment="Top" Width="45" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="i" Tag="IsLetter" Content="i" Style="{StaticResource KeyboardButtonStyle}" Margin="337,0,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" Height="90" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="o" Tag="IsLetter" Content="o" Style="{StaticResource KeyboardButtonStyle}" Margin="385,0,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" Height="90" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="p" Tag="IsLetter" Content="p"  Style="{StaticResource KeyboardButtonStyle}" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" Height="90" VerticalAlignment="Top" Margin="433,0,0,0" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="a" Tag="IsLetter" Content="a" Style="{StaticResource KeyboardButtonStyle}" Margin="20,97,0,0" Height="90" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="s" Tag="IsLetter" Content="s" Style="{StaticResource KeyboardButtonStyle}" Margin="69,97,0,0" Height="90" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="d" Tag="IsLetter" Content="d" Style="{StaticResource KeyboardButtonStyle}" Margin="117,97,0,0" Height="90" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="f" Tag="IsLetter" Content="f" Style="{StaticResource KeyboardButtonStyle}" Margin="165,97,0,0" Height="90" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="g" Tag="IsLetter" Content="g" Style="{StaticResource KeyboardButtonStyle}" Margin="214,97,0,0" Height="90" Click="Button_Click" FontWeight="Bold" VerticalAlignment="Top" HorizontalAlignment="Left" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="h" Tag="IsLetter" Content="h" Style="{StaticResource KeyboardButtonStyle}" Margin="263,97,0,0" Height="90" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="j" Tag="IsLetter" Content="j" Style="{StaticResource KeyboardButtonStyle}" Margin="312,97,0,0" Height="90" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="k" Tag="IsLetter" Content="k" Style="{StaticResource KeyboardButtonStyle}" Margin="361,97,0,0" Height="90" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="l" Tag="IsLetter" Content="l" Style="{StaticResource KeyboardButtonStyle}" Margin="409,97,0,0" Height="90" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="caps" Width="65" Content="↑" Style="{StaticResource KeyboardButtonStyle}" Margin="0,194,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="Height" FontSize="48" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="z" Tag="IsLetter" Content="z" Style="{StaticResource KeyboardButtonStyle}" Margin="69,194,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="Height" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="x" Tag="IsLetter" Content="x" Style="{StaticResource KeyboardButtonStyle}" Margin="117,194,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="Height" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="c" Tag="IsLetter" Content="c" Style="{StaticResource KeyboardButtonStyle}" Margin="165,194,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="Height" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="v" Tag="IsLetter" Content="v" Style="{StaticResource KeyboardButtonStyle}" Margin="214,194,0,0" Click="Button_Click" FontWeight="Bold" Width="45" VerticalAlignment="Top" d:LayoutOverrides="Height" MouseLeave="Button_MouseLeave" HorizontalAlignment="Left" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="b" Tag="IsLetter" Content="b" Style="{StaticResource KeyboardButtonStyle}" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="Height" MouseLeave="Button_MouseLeave" Margin="263,194,0,0" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="n" Tag="IsLetter" Content="n" Style="{StaticResource KeyboardButtonStyle}" Margin="312,194,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="Height" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="m" Tag="IsLetter" Content="m" Style="{StaticResource KeyboardButtonStyle}" Margin="361,194,0,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="Height" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="delete" Content="←" Width="70" Style="{StaticResource KeyboardButtonStyle}" Margin="0,194,1,0" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Right" VerticalAlignment="Top" d:LayoutOverrides="Height" ClickMode="Press" FontSize="48" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="numeric" Content="&amp;123" Width="65" FontSize="18.667" Style="{StaticResource KeyboardButtonStyle}" Height="90" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Bottom" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="comma" Content="," Style="{StaticResource KeyboardButtonStyle}" Margin="69,0,0,0" Height="90" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Bottom" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="dot" Content="." Style="{StaticResource KeyboardButtonStyle}" Margin="117,0,0,0" Height="90" Click="Button_Click" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Bottom" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="space" Content="space" FontSize="18.667" Style="{StaticResource KeyboardButtonStyle}" Margin="165,0,0,0" Height="90" Click="Button_Click" FontWeight="Bold" VerticalAlignment="Bottom" Width="94" BorderThickness="0" HorizontalAlignment="Left" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="left" Content="←" Style="{StaticResource KeyboardButtonStyle}" Margin="0,0,172,0" Height="90" Click="Button_Click" FontWeight="Bold" VerticalAlignment="Bottom" HorizontalAlignment="Right"  MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="right" Content="→"  Style="{StaticResource KeyboardButtonStyle}" Margin="0,0,123,0" Height="90" Click="Button_Click" FontWeight="Bold" VerticalAlignment="Bottom" HorizontalAlignment="Right" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="language" Content="EN" FontSize="18.667" Style="{StaticResource KeyboardButtonStyle}" Margin="0,0,74,0" Height="90" Click="Button_Click" FontWeight="Bold" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="45" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove"/>
                <Button x:Name="enter" Content="↵" Style="{StaticResource KeyboardButtonStyle}" Height="90" Click="Button_Click" FontWeight="Bold" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="70" Margin="0,0,1,0" FontSize="48" MouseLeave="Button_MouseLeave" MouseEnter="Button_MouseEnter" MouseMove="Button_MouseMove">
                </Button>
                <Border x:Name="rolloverBorder" Visibility="Collapsed" Tag="IsLetter" Style="{StaticResource BorderPreviewStyle}" HorizontalAlignment="Left" VerticalAlignment="Top">
                    <TextBlock x:Name="rolloverTextBlock" Style="{StaticResource TextBlockPreviewStyle}" />
                </Border>
            </Grid>
            <my:RoundButton Content="Copy" Height="85" HorizontalAlignment="Left" Margin="410,108,0,0" Name="copyButton" ImagePath="/Images/copy.png" VerticalAlignment="Top" Width="68" Click="copyButton_Click" />
        </Grid>
        
    </Grid>
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/sms.png" Text="SMS" Click="ApplicationBarIconButtonSMS_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Images/email.png" Text="E-Mail" Click="ApplicationBarIconButtonEmail_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Images/bing.png" Text="Bing" Click="ApplicationBarIconButtonBing_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Images/google.png" Text="Google" Click="ApplicationBarIconButtonGoogle_Click"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="About" x:Name="aboutMnu" Click="aboutMnu_Click" />
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
        

    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>